﻿<UserControl 
    x:Class="MTGenome.Views.CardDetailView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:caliburn="http://www.caliburnproject.org"
    xmlns:ui="clr-namespace:MTGenome.UI;assembly=MTGenome.UI"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>

        <Grid Margin="10">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="25" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="175" />
                <ColumnDefinition Width="10" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

            <TextBlock Grid.Row="0" Margin="2" TextAlignment="Right" FontWeight="Bold">Card Name:</TextBlock>
            <TextBlock Grid.Row="1" Margin="2" TextAlignment="Right" FontWeight="Bold" Visibility="{Binding Converter={StaticResource {x:Type BooleanToVisibilityConverter}}, Path=HasManaCost}">Mana Cost:</TextBlock>
            <TextBlock Grid.Row="2" Margin="2" TextAlignment="Right" Visibility="{Binding Converter={StaticResource {x:Type BooleanToVisibilityConverter}}, Path=HasManaCost}">Converted Mana Cost:</TextBlock>
            <TextBlock Grid.Row="3" Margin="2" TextAlignment="Right" FontWeight="Bold">Type:</TextBlock>
            <TextBlock Grid.Row="4" Margin="2" TextAlignment="Right" FontWeight="Bold">Card Text:</TextBlock>
            <TextBlock Grid.Row="5" Margin="2" TextAlignment="Right" FontWeight="Bold" Visibility="{Binding Converter={StaticResource {x:Type BooleanToVisibilityConverter}}, Path=HasFlavorText}">Flavor Text:</TextBlock>
            <TextBlock Grid.Row="6" Margin="2" TextAlignment="Right" FontWeight="Bold">Expansion:</TextBlock>
            <TextBlock Grid.Row="7" Margin="2" TextAlignment="Right" FontWeight="Bold">Rarity:</TextBlock>
            <TextBlock Grid.Row="8" Margin="2" TextAlignment="Right" FontWeight="Bold">Artist</TextBlock>

            <TextBlock Grid.Row="0" Margin="2" Grid.Column="2" Text="{Binding Name}" />
            <TextBlock Grid.Row="1" Margin="2" Grid.Column="2" Visibility="{Binding Converter={StaticResource {x:Type BooleanToVisibilityConverter}}, Path=HasManaCost}" Text="{Binding ManaCost}" />
            <TextBlock Grid.Row="2" Margin="2" Grid.Column="2" Visibility="{Binding Converter={StaticResource {x:Type BooleanToVisibilityConverter}}, Path=HasManaCost}" Text="{Binding ConvertedManaCost}" />
            <TextBlock Grid.Row="3" Margin="2" Grid.Column="2" Text="{Binding Type}" />
            <TextBlock Grid.Row="4" Margin="2" Grid.Column="2" ui:TextBlockBehavior.ItemsSource="{Binding Text}" TextWrapping="Wrap" />
            <TextBlock Grid.Row="5" Margin="2" Visibility="{Binding Converter={StaticResource {x:Type BooleanToVisibilityConverter}}, Path=HasFlavorText}" Grid.Column="2" Text="{Binding FlavorText}" FontStyle="Italic" />

            <StackPanel Orientation="Horizontal" Grid.Row="6" Grid.Column="2">
                <Image HorizontalAlignment="Left" Margin="2" Source="{Binding Expansion}" />
                <TextBlock Margin="2" Text="{Binding ExpansionText}" />
            </StackPanel>
            <TextBlock Grid.Row="7" Margin="2" Grid.Column="2" Text="{Binding Rarity}" />
            <TextBlock Grid.Row="8" Margin="2" Grid.Column="2" Text="{Binding Artist}" />
        </Grid>

        <Image Grid.Column="1" VerticalAlignment="Top" Margin="10" Source="{Binding Image}" />

        <Control x:Name="busyIndicator" Visibility="Collapsed" Style="{StaticResource Spinner}" Grid.ColumnSpan="2" />

    </Grid>
</UserControl>
